package com.lgz.dbcourse.mapper;

import com.lgz.dbcourse.dto.StaffOutputDTO;
import com.lgz.dbcourse.entity.StaffEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: LGZ
 * @Date: 2021/4/10 15:17
 * @Description:
 */

public interface StaffMapper {
    /**
     * TODO
     * @Description 使用用户名密码登录
     * @Author lgz
     * @Date 2021/4/10 15:54
     * @param staffEntity : 员工实体
     * @return : com.lgz.dbcourse.dto.StaffOutputDTO
     */
    @Select("SELECT * " +
            "FROM staff " +
            "WHERE password = MD5(#{staffEntity.password}) " +
            "AND username = #{staffEntity.username}")
    StaffOutputDTO getStaffByPassword(@Param("staffEntity")StaffEntity staffEntity);

}
